<!DOCTYPE html>
<html lang="en">

	<include file="Public:header" />
	<include file="Public:page_css" />
	<script>

$(function(){
	$('textarea.limited').maxlength({
		'feedback' : '.charsLeft', 
	});
	  
	$('textarea.limitedone').maxlength({
		'feedback' : '.charsLeftone', 
	});
	
	$('#sys').ajaxForm({
		beforeSubmit: checkForm, // 此方法主要是提交前执行的方法，根据需要设置
		success: complete, // 这是提交后的方法
		dataType: 'json'
	});
	
	function checkForm(){
		if( '' == $.trim($('#sys_name').val())){
			$('#resone').attr("class", "middle highmsg");//ID为resone 重新class赋值
			$('#resone').html('*网站名称不能为空').show();//id为resone 赋值html值
			$('#sys_name').focus(); 
			return false;
		}
		
		if( '' == $.trim($('#sys_url').val())){
			$('#restwo').attr("class", "middle highmsg");//ID为resone 重新class赋值
			$('#resone').html('').show();//id为resone 赋值html值
			$('#restwo').html('网址不能为空').show();//id为resone 赋值html值
			$('#sys_url').focus(); 
			return false;
		}

 }
	function complete(data){
		if(data.status==1){
			layer.msg(data.info, {icon: 6, time:1000}, function(index){
 			
			window.location.href="{:U('Sys/sys')}";
			});
		}else{
			layer.msg(data.info, {icon: 5, time:1000});
			return false;	
		}
	}
 
});
</script>
	<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
		<include file="Public:nav" />
		<div class="row wrapper border-bottom white-bg page-heading">
            <div class="col-lg-12">
                <h2>网站设置</h2>
                <ol class="breadcrumb">
                    <li>
                        <a href="{:U('Index/index')}"><i class="fa fa-home"></i> 主页</a>
                    </li>
                    <li>
                        <a>网站管理</a>
                    </li>
                    <li>
                        <strong>网站设置</strong>
                    </li>
                </ol>
            </div>              
        </div>
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<h5>网站设置</h5>
						<div class="ibox-tools">
							<a class="collapse-link">
								<i class="fa fa-chevron-up"></i>
							</a>
						</div>
					</div>
					<div class="ibox-content">
						<form name="sys" id="sys" method="post" action="{:U('sys')}" class="form-horizontal">
						<input type="hidden" name="sys_id" value="{$sys.sys_id}" />
							<div class="form-group">
								<label class="col-sm-2 control-label">网站名称</label>
								<div class="col-sm-6">
									<input type="text" name="sys_name" id="sys_name" value="{$sys.sys_name}" class="form-control" placeholder="输入网站名称"/>
								</div>
								<span class="help-inline col-sm-4">
									<span class="middle" style="color: red" id="resone"></span>
								</span>
							</div>
							<div class="hr-line-dashed"></div>
							<div class="form-group">
								<label class="col-sm-2 control-label">URL地址</label>
								<div class="col-sm-6">
									<input type="text" name="sys_url" id="sys_url" value="{$sys.sys_url}"  placeholder="输入网站绑定的URL地址" class="form-control">
								</div>
								<span class="help-inline col-sm-4">
									<span class="middle" style="color: red" id="resone"></span>
								</span>
							</div>
							<div class="hr-line-dashed"></div>
							<div class="form-group">
								<label class="col-sm-2 control-label"> 首页SEO标题 </label>
								<div class="col-sm-6">
									<input type="text" name="sys_title" id="sys_title" value="{$sys.sys_title}"  class="form-control" />
								</div>
								<span class="help-inline col-sm-4">
										<span class="middle" id="resthr"></span>
								</span>
							</div>
							<div class="hr-line-dashed"></div>
							<div class="form-group">
								<label class="col-sm-2 control-label">首页SEO关键字</label>
								<div class="col-sm-6">
									<textarea type="text" name="sys_key"  placeholder="首页SEO关键字" class="form-control limited"  id="form-field-9"  maxlength="100">{$sys.sys_key}</textarea>
								</div>
								<input type="hidden" name="maxlength" value="100" />
                                           
								<p>还可以输入 <span style="color: red" class="middle charsLeft"></span> 个字符,以英文 , 号隔开</p>
											
							</div>
							<div class="hr-line-dashed"></div>
							<div class="form-group">
								<label class="col-sm-2 control-label">首页SEO描述</label>
								<div class="col-sm-6">
									<textarea type="text" name="sys_des" rows="5" placeholder="首页SEO描述" class="form-control limitedone"  id="form-field-10"  maxlength="100">{$sys.sys_des}</textarea>
								</div>
								<input type="hidden" name="maxlength" value="200" />
                                           
								<p>还可以输入 <span style="color: red" class="middle charsLeftone"></span> 个字符</p>
											
							</div>
							<div class="hr-line-dashed"></div>
							<div class="form-group">
								<div class="col-sm-4 col-sm-offset-2">
									<button class="btn btn-primary" type="submit"><i class="fa fa-save"></i> 保存</button>&nbsp;&nbsp;&nbsp;
									<a class="btn btn-danger" href="{:U('Index/index')}"><i class="fa fa-close"></i> 取消</a>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
		<include file="Public:footer" />
		<script src="__PUBLIC__/Admin/js/maxlength.js"></script>

	</body>

</html>



